<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/import.jsp"%>
<html>
	<head>
		<c:set var="title" value="统一登录系统管理控制台"/>
		<title>${title}</title>
		<script>
		//添加tab页面
		function addTab(title, url) {
			if ($('#maintabs').tabs('exists', title)) {
				$.messager.confirm('确认','确定要刷新标签页： <font color=red>' + title + '</font> 吗?',
								function(flag) {
									if (flag) {
										var content = '<iframe scrolling="auto" frameborder="0"  src="'
												+ url
												+ '" style="width:100%;height:100%;"></iframe>';
										var tab = $('#maintabs').tabs('getTab',
												title);
										$('#maintabs').tabs('update', {
											tab : tab,
											options : {
												title : title,
												content : content,
												closable : true
											}
										});
										$('#maintabs').tabs('select', title);
									}
								});
			} else {
				var content = '<iframe scrolling="auto" frameborder="0"  src="'
						+ url + '" style="width:100%;height:100%;"></iframe>';
				$('#maintabs').tabs('add', {
					title : title,
					content : content,
					closable : true
				});
			}
		}

  	//用户退出
  	function lgnout(){
  		$.messager.confirm('提示', '您确定工作已经保存,并退出该系统?', function(r){
	  		if (r){	
		  		var outUrl = '${ctx}/passport/logout/logout.action';
		  		var mainPage = '${ctx}';
			  		$.ajax({
			  			url:outUrl,
			  			type:'post',
			  			success:function(data){
			  				var result = jQuery.parseJSON(data);
			  				if (result.flag == 'T') {
								window.location.href = '${ctx}';
							} else {
								$.messager.alert('提交结果', result.msg, 'info');
							}
			  			},
			  			error:function(data){
			  				alert("请检查服务器!");
			  			}
			  		});
	  		}
  		});
  	}
</script>

<style>

h3 {
	width: 98%;
	border: 1px solid #eee;
	margin: 2px;
	margin-left: 2px;
	height: 20px;
	font-size: 12px;
	font-weight: normal;
	line-height: 20px;
	vertical-align: center;
	text-indent: 5px;
	cursor: pointer;
}
</style>
	</head>
	<body class="easyui-layout" style="overflow-y: hidden" scroll="no">
		<div region="north" border="false"
			style="height: 80px; background: #a8d7e9;">
			<div id="top" class="top" region="north" border="false">
				<span
					style="float: left; line-height: 66px; font-size: 30px; font-family: 微软雅黑; color: #000000; text-shadow: 5px 5px 5px #0c4b09">
					&nbsp;&nbsp;&nbsp;&nbsp;${title}</span>
				<span style="float: right; padding: 4px;"> 
				<font color="#9282;">欢迎您：<%=session.getAttribute("userEname")%>|</font> 
				<font color="#ddeeff"><a href="#" onclick="lgnout();" style="text-decoration: none; color: #9282;">退出系统</a> </font> 
				</span>
			</div>
		</div>
		<div region="west" split="true" title="功能菜单列表"
			style="width: 190px; padding: 0px;">
			<div title="" iconCls="icon-undo">
				<h3 onclick="addTab('外部系统管理','${ctx}/passport/ssosys/sys-list.action')">外部系统管理</h3>
				<h3 onclick="addTab('黑名单管理','${ctx}/passport/black/black-list.action')">黑名单管理</h3>
				<h3 onclick="addTab('对外接口管理','${ctx}/protocol/list.action')">对外接口管理</h3>
				<h3 onclick="addTab('受限制用户管理','${ctx}/passport/cache/cache-list.action')">受限制用户管理</h3>
				<h3 onclick="addTab('当前登录用户列表','${ctx}/passport/cache/cache-user-list.action')">当前登录用户列表</h3>
				<h3 onclick="addTab('定时任务列表','${ctx}/task/list.action')">定时任务列表</h3>
				<h3 onclick="addTab('登录登出历史列表','${ctx}/logger/sign/sign-list.action')">登录登出历史列表</h3>
			</div>
		</div>
		<div id="mainPanle" region="center" style="overflow: hidden;">
			<div id="maintabs" class="easyui-tabs" fit="true" border="false">
				<div class="easyui-tab" title="首页" href=""
					style="padding: 2px; overflow: hidden;">
					<div class="demo-info" style="margin-bottom: 10px">
						<div class="demo-tip icon-tip"></div>
						<div>
							${title }
						</div>
					</div>
				</div>
			</div>
		</div>
		<div region="east" split="true" title="附加功能"
			style="width: 250px; padding: 10px;">
			<div class="demo-info" style="margin-bottom: 10px">
				<div class="demo-tip icon-tip"></div>
				<div>
					工作日历
				</div>
			</div>
			<div class="easyui-calendar" style="width: 180px; height: 180px;"></div><br>
		</div>
<!-- 底部 -->
<div region="south" border="false" style="height: 25px; overflow: hidden;">
	<div align="center" style="color: #1C86EE; padding-top: 2px">&copy; 版权所有 <span class="tip"><a href="http://www.dwusoft.com/" title="${title}">${sysTitle }</a><label id="show" /> </span></div>
</div>
</body>

</html>